#include <iostream>
using namespace std;
int n, ans, sum = 1;
int M = 1000000007;
int main(){
	cin >> n;
	for (int i = 1; i <= n; i++){
		ans = (ans + i % 5) % M;
		if (i != n) sum = sum * i % M;
	}
	//cout << sum << " " << ans << endl;
	cout << sum * ans % M << endl;
    return 0;
}


